﻿
namespace Taste.Internal
{
    internal class StateTransition<TState> : IStateTransition<TState>
        where TState : struct
    {
        public StateTransition(object userData)
        {
            this.UserData = userData;
        }

        public object UserData { get; set; }
        public TState NextStateName { get; set; }
        public object NextUserData { get; set; }
        public bool? IsAccepted { get; set; }

        public void AcceptAndEnter(TState nextStateName, object nextUserData)
        {
            this.NextStateName = nextStateName;
            this.NextUserData = nextUserData;
            this.IsAccepted = true;
        }

        public void Reject()
        {
            this.IsAccepted = false;
        }
    }
}
